package com.wetao.lib_common.greendao.model;


import org.greenrobot.greendao.annotation.Entity;

import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.NotNull;
import org.greenrobot.greendao.annotation.ToMany;
import org.greenrobot.greendao.annotation.Transient;
import org.greenrobot.greendao.annotation.Unique;

import java.util.List;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.DaoException;
import com.wetao.lib_common.greendao.dao.DaoSession;
import com.wetao.lib_common.greendao.dao.PenOffLineGridInfoChildDao;
import com.wetao.lib_common.greendao.dao.PenOffLineGridInfoDao;

@Entity
public class PenOffLineGridInfo {

    public PenOffLineGridInfo copy(PenOffLineGridInfo old) {
        return new PenOffLineGridInfo(old.id, old.picId, old.pageserial,
                old.bookId, old.ownerNo, old.sectionNo, old.pageNumber,
                old.width, old.height, old.pictureUrl, old.subjectCode,
                old.status, old.examName, old.assistantName,
                old.subjectName, old.bookName, old.examId, old.isMore,
                old.startX_L, old.startY_L, old.endX_L, old.endY_L,
                old.startX_R, old.startY_R, old.endX_R, old.endY_R,
                old.beginTime, old.finishTime, old.ossPath, old.scale, old.isWrite,
                old.examPageNumber, old.examPageNo, old.isAnswerSheet, old.sourceType);
    }

    @Id(autoincrement = true)
    private Long id;

    //铺码图片id
    private Integer picId;
    //云叠的序列号
    private String pageserial;
    //
    private Integer bookId;
    //
    private Integer ownerNo;
    //
    private Integer sectionNo;
    //页码
    private Integer pageNumber;
    //宽度
    private Integer width;
    //高度
    private Integer height;
    //图片地址
    private String pictureUrl;
    //
    private Integer subjectCode;
    //
    private Integer status;
    //试卷名称
    private String examName;
    //教辅名称
    private String assistantName;
    //学科
    private String subjectName;
    //教辅节点名称
    private String bookName;
    //
    private Integer examId;


    //下面这些参数要自己计算
    private boolean isMore; //这一张图片是否只有一个章节
    private Float startX_L; //如果一张图片有两个章节，需要计算坐标区分
    private Float startY_L;
    private Float endX_L;
    private Float endY_L;
    private Float startX_R; //如果一张图片有两个章节，需要计算坐标区分, 有的区分左右两列
    private Float startY_R;
    private Float endX_R;
    private Float endY_R;
    private String beginTime;
    private String finishTime;
    private String ossPath;
    private Integer scale; //图片放大倍数
    private boolean isWrite; //为了判断一页两课时中，其中一个课时没有写字的情况；必须isMore=true这个字段才生效，判断当前课时是否涂鸦了。


    //下面这些是后面加的，不需要计算
    //试卷页数
    private Integer examPageNumber;
    //当前页码
    private Integer examPageNo;
    //是否为答题卡 1 答题卡 2 其他铺码 3 通用作答本 4 智能作答本
    private Integer isAnswerSheet;
    //资源类型 1：教辅 2 知识图谱
    private Integer sourceType;

    //页面格子信息
    @ToMany(referencedJoinProperty = "penOffLineGridInfoId")
    List<PenOffLineGridInfoChild> grids;

    @Transient
    public Integer showType; //列表中显示type ,1:章节课时名字；2:图片； 3: 共多少页; 4:最后一行空白
    @Transient
    public boolean isSelect; //是否选中
    @Transient
    public Integer pageNum; //显示图片的页数

    /** Used to resolve relations */
    @Generated(hash = 2040040024)
    private transient DaoSession daoSession;

    /** Used for active entity operations. */
    @Generated(hash = 1925093972)
    private transient PenOffLineGridInfoDao myDao;
    @Generated(hash = 386416931)
    public PenOffLineGridInfo(Long id, Integer picId, String pageserial, Integer bookId, Integer ownerNo,
            Integer sectionNo, Integer pageNumber, Integer width, Integer height, String pictureUrl,
            Integer subjectCode, Integer status, String examName, String assistantName, String subjectName,
            String bookName, Integer examId, boolean isMore, Float startX_L, Float startY_L, Float endX_L,
            Float endY_L, Float startX_R, Float startY_R, Float endX_R, Float endY_R, String beginTime,
            String finishTime, String ossPath, Integer scale, boolean isWrite, Integer examPageNumber,
            Integer examPageNo, Integer isAnswerSheet, Integer sourceType) {
        this.id = id;
        this.picId = picId;
        this.pageserial = pageserial;
        this.bookId = bookId;
        this.ownerNo = ownerNo;
        this.sectionNo = sectionNo;
        this.pageNumber = pageNumber;
        this.width = width;
        this.height = height;
        this.pictureUrl = pictureUrl;
        this.subjectCode = subjectCode;
        this.status = status;
        this.examName = examName;
        this.assistantName = assistantName;
        this.subjectName = subjectName;
        this.bookName = bookName;
        this.examId = examId;
        this.isMore = isMore;
        this.startX_L = startX_L;
        this.startY_L = startY_L;
        this.endX_L = endX_L;
        this.endY_L = endY_L;
        this.startX_R = startX_R;
        this.startY_R = startY_R;
        this.endX_R = endX_R;
        this.endY_R = endY_R;
        this.beginTime = beginTime;
        this.finishTime = finishTime;
        this.ossPath = ossPath;
        this.scale = scale;
        this.isWrite = isWrite;
        this.examPageNumber = examPageNumber;
        this.examPageNo = examPageNo;
        this.isAnswerSheet = isAnswerSheet;
        this.sourceType = sourceType;
    }
    @Generated(hash = 148836727)
    public PenOffLineGridInfo() {
    }
    public Long getId() {
        return this.id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public Integer getPicId() {
        return this.picId;
    }
    public void setPicId(Integer picId) {
        this.picId = picId;
    }
    public String getPageserial() {
        return this.pageserial;
    }
    public void setPageserial(String pageserial) {
        this.pageserial = pageserial;
    }
    public Integer getBookId() {
        return this.bookId;
    }
    public void setBookId(Integer bookId) {
        this.bookId = bookId;
    }
    public Integer getOwnerNo() {
        return this.ownerNo;
    }
    public void setOwnerNo(Integer ownerNo) {
        this.ownerNo = ownerNo;
    }
    public Integer getSectionNo() {
        return this.sectionNo;
    }
    public void setSectionNo(Integer sectionNo) {
        this.sectionNo = sectionNo;
    }
    public Integer getPageNumber() {
        return this.pageNumber;
    }
    public void setPageNumber(Integer pageNumber) {
        this.pageNumber = pageNumber;
    }
    public Integer getWidth() {
        return this.width;
    }
    public void setWidth(Integer width) {
        this.width = width;
    }
    public Integer getHeight() {
        return this.height;
    }
    public void setHeight(Integer height) {
        this.height = height;
    }
    public String getPictureUrl() {
        return this.pictureUrl;
    }
    public void setPictureUrl(String pictureUrl) {
        this.pictureUrl = pictureUrl;
    }
    public Integer getSubjectCode() {
        return this.subjectCode;
    }
    public void setSubjectCode(Integer subjectCode) {
        this.subjectCode = subjectCode;
    }
    public Integer getStatus() {
        return this.status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
    public String getExamName() {
        return this.examName;
    }
    public void setExamName(String examName) {
        this.examName = examName;
    }
    public String getAssistantName() {
        return this.assistantName;
    }
    public void setAssistantName(String assistantName) {
        this.assistantName = assistantName;
    }
    public String getSubjectName() {
        return this.subjectName;
    }
    public void setSubjectName(String subjectName) {
        this.subjectName = subjectName;
    }
    public String getBookName() {
        return this.bookName;
    }
    public void setBookName(String bookName) {
        this.bookName = bookName;
    }
    public Integer getExamId() {
        return this.examId;
    }
    public void setExamId(Integer examId) {
        this.examId = examId;
    }
    public boolean getIsMore() {
        return this.isMore;
    }
    public void setIsMore(boolean isMore) {
        this.isMore = isMore;
    }
    public Float getStartX_L() {
        return this.startX_L;
    }
    public void setStartX_L(Float startX_L) {
        this.startX_L = startX_L;
    }
    public Float getStartY_L() {
        return this.startY_L;
    }
    public void setStartY_L(Float startY_L) {
        this.startY_L = startY_L;
    }
    public Float getEndX_L() {
        return this.endX_L;
    }
    public void setEndX_L(Float endX_L) {
        this.endX_L = endX_L;
    }
    public Float getEndY_L() {
        return this.endY_L;
    }
    public void setEndY_L(Float endY_L) {
        this.endY_L = endY_L;
    }
    public Float getStartX_R() {
        return this.startX_R;
    }
    public void setStartX_R(Float startX_R) {
        this.startX_R = startX_R;
    }
    public Float getStartY_R() {
        return this.startY_R;
    }
    public void setStartY_R(Float startY_R) {
        this.startY_R = startY_R;
    }
    public Float getEndX_R() {
        return this.endX_R;
    }
    public void setEndX_R(Float endX_R) {
        this.endX_R = endX_R;
    }
    public Float getEndY_R() {
        return this.endY_R;
    }
    public void setEndY_R(Float endY_R) {
        this.endY_R = endY_R;
    }
    public String getBeginTime() {
        return this.beginTime;
    }
    public void setBeginTime(String beginTime) {
        this.beginTime = beginTime;
    }
    public String getFinishTime() {
        return this.finishTime;
    }
    public void setFinishTime(String finishTime) {
        this.finishTime = finishTime;
    }
    public String getOssPath() {
        return this.ossPath;
    }
    public void setOssPath(String ossPath) {
        this.ossPath = ossPath;
    }
    public Integer getScale() {
        return this.scale;
    }
    public void setScale(Integer scale) {
        this.scale = scale;
    }
    public boolean getIsWrite() {
        return this.isWrite;
    }
    public void setIsWrite(boolean isWrite) {
        this.isWrite = isWrite;
    }
    public Integer getExamPageNumber() {
        return this.examPageNumber;
    }
    public void setExamPageNumber(Integer examPageNumber) {
        this.examPageNumber = examPageNumber;
    }
    public Integer getExamPageNo() {
        return this.examPageNo;
    }
    public void setExamPageNo(Integer examPageNo) {
        this.examPageNo = examPageNo;
    }
    public Integer getIsAnswerSheet() {
        return this.isAnswerSheet;
    }
    public void setIsAnswerSheet(Integer isAnswerSheet) {
        this.isAnswerSheet = isAnswerSheet;
    }
    public Integer getSourceType() {
        return this.sourceType;
    }
    public void setSourceType(Integer sourceType) {
        this.sourceType = sourceType;
    }
    /**
     * To-many relationship, resolved on first access (and after reset).
     * Changes to to-many relations are not persisted, make changes to the target entity.
     */
    @Generated(hash = 437089470)
    public List<PenOffLineGridInfoChild> getGrids() {
        if (grids == null) {
            final DaoSession daoSession = this.daoSession;
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            PenOffLineGridInfoChildDao targetDao = daoSession.getPenOffLineGridInfoChildDao();
            List<PenOffLineGridInfoChild> gridsNew = targetDao
                    ._queryPenOffLineGridInfo_Grids(id);
            synchronized (this) {
                if (grids == null) {
                    grids = gridsNew;
                }
            }
        }
        return grids;
    }
    /** Resets a to-many relationship, making the next get call to query for a fresh result. */
    @Generated(hash = 881301400)
    public synchronized void resetGrids() {
        grids = null;
    }
    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#delete(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 128553479)
    public void delete() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.delete(this);
    }
    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#refresh(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 1942392019)
    public void refresh() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.refresh(this);
    }
    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#update(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 713229351)
    public void update() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.update(this);
    }
    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 1670129307)
    public void __setDaoSession(DaoSession daoSession) {
        this.daoSession = daoSession;
        myDao = daoSession != null ? daoSession.getPenOffLineGridInfoDao() : null;
    }

}
